Toothpaste - A Multiple Splineattach Tutorial
by thorn

Multiple Splineattach offers a lot of possibilities. One of the great things it can do is animate the position of objects on a spline over time. This feature can be used to create several effects. We're going to use it along with a Loft NURBS object to create a stream of toothpaste which grows over time.

I'm going to assume you have a basic knowledge of XL and it's menus... so I'm just going to mention functions by name, for the most part - instead of listing where the command is in the menu, under which manager, etc. I'd also suggest you take a look at the enclosed scene file, which contains all the elements we'll be creating.

So - enough talk... let's make some toothpaste!

thorn
June 5, 1998

 

Step One - Create the Elements

Start by creating a spline in a curved shape. The default hemite spline dialog usually works well. Be sure to leave it open-ended. This will define the shape of the toothpaste.

Next, create a circle spline primitive, with a fairly small radius.

Duplicate this circle object, making 60-70 copies. Don't worry about defining a particular offset, as it won't matter as we go further along.

You can delete the original circle; it will not be further used. At this point, you should have 2 objects in the object manager: the spline, and an object group (with many circle-spline sub-objects).

 

Step Two - Create the NURBS hierarchy

Create a Loft NURBS. Name the NURBS object "Toothpaste".

Use these parameters as a guide:

Isobaths: 5
Shading: 32
Raytracer: 64
Display Isobaths: Off (This is a personal preference).

Now, drag the "Object group"(with the circle-spline subobjects) on the Toothpaste NURBS object. Keep the "Object group"highlighted, and select Expand Group Object from the Object Manager menu. This will delete the "Object group" parent, leaving the circle-splines as direct sub-objects of the Toothpaste parent.

 

Step Three - Create the Effect

Enter the sequencer. Highlight the Spline object, and add a Multiple Splineattatch track. Create a sequence length of Frame 0 to Frame 59. In the dialog below, notice there are 2 keyframes: one at each end of the sequence.

Create a keyframe at Frame 0. This will bring up the Multiple Splineattach dialogs:

The first field you need to fill in is Group:. Enter Toothpaste, as this is the object group we want to attach the the curvy spline. We don't need to use the Rename function, so leave it at 0, which means "off". For "Type", input 1; this sets the plugin to place the toothpaste circle-splines on a group-wide basis. Set the Align type and Pos. (Position) type to 1. We won't be using the scaling option so leave Use scaling: at 0, which means "off". Click OK to get the next dialog:

The first field is From:, in which we'll input 1. This means we will use overall percentage (relative to the length of the curvy spline) to place the cross sections. For the From: and To: Percent fields, input 0% for both. This means that for the first keyframe, the cross sections will all be at the beginning of the spline.

Now we're going to set the Align method. MSA allows the cross sections to have an alignment (or rotation) based on several factors. We're going to use Method: 1, which is Vector alignment. This will make the cross sections use a universally defined vector for their alignment. For Align (on/off), input 1 (which means "on") for heading, pitch, and bank. Click OK to get the next dialog:

Now we're going to input the Alignment settings (or rotation) of the circle-splines. Because we set the Align type to Vector in the previous dialog, we'll be using these vector coordinates for alignment. For this effect, we want the circle-splines to always be perpendicular to the world XZ axis, so we'll set their Y axes to always use the 0,1,0 point for alignment. We don't want them to bank, so leave the Banking angle at 0 degrees. Clicking OK will close the MSA dialog.

Now, we aren't quite finished. Control-drag the Frame 0 keyframe to Frame 59 (this copies the keyframe). Double-click the key at Frame 59 to edit the MSA settings for this key. Click OK for the first dialog. At the second dialog, we need to make a small change:

Change the To: Percent to 100%. Remember: at Frame 0 we set it to 0%. What we are doing is animating the cross-section placement ment over time. At Frame 0, they will all be placed at the beginning of the spline. At Frame 59, they will be placed evenly from the beginning to the end of the spline. Click OK on this and the next 2 dialogs, and we're almost finished.

 

Step Four - Take a Look!

Move the Time Manager slider a bit, and you should see the cross sections move along the spline path.

 

Step Five - Texture and Close the Ends!

Apply a texture to the NURBS object using UV mapping. The enclosed scene has a toothpaste-type texture which works well. If you do a quick render, you'll notice that the toothpaste is hollow - well, let's fix that!

Simply perform an extrusing on the first and last circle spline in the Toothpaste object. The extrusion objects will appear at the top of the object manager. Drag them to become sub-objects of the respective circles, and your ends will now be closed.

 

Last Step - Save and Render!

That's all there is to it!

I hope you've found this tutorial helpful. Multiple Splineattach is a very deep plugin, but it should be a bit more clear now. Be sure to look for future tutorials which will explore other uses for this great plugin!

And remember - if you aren't having fun, you're doing something wrong!

thorn

 

 

© 1998 by thorn